/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DescriptionText.java
 *
 * Created on 14/Dez/2011, 20:57:54
 */

package intopo.game;

import intopo.evogame.partnerselection.config.ParsingException;
import java.io.PrintStream;
import java.lang.reflect.Constructor;
import java.util.Map;
import java.util.Scanner;

/**
 * This interface defines methods that permit reading and writing game data from a text stream.  Reading is encapsulated in the {@code Scanner} class.  Writing is done via a {@code PrintStream} instance.
 * A game designer must implement a method to read and write global parameters that affect all instances of classes that model the game.  Reading and writing strategies and games is done via a constructor and a method, respectvely.
 *
 * @author <a href="mailto:mariano.pedro@gmail.com">Pedro Mariano</a>
 *
 * @version 1.0 14/Dez/2011
 */
public interface DescriptionText<G extends Game<S>, S extends Strategy<S>>
	extends Description<G, S>
{
	/**
	 * Return a map that associates strings to game constructors. These
	 * strings identify which particular implementation of game {@code G}
	 * should be used.  Different implementations may simulate all
	 * iterations of an iterated game. On the other hand, it may compute how
	 * some strategies would behave in a iterated game.
	 */
	Map<String, Constructor<? extends G>> getGameConstructor ();
	/**
	 * Return a map that associates tag names to strategy constructors.
	 */
	Map<String, Constructor<? extends S>> getStrategyConstructors ();
	/**
	 * Reads global parameters that affect the behaviour of all game and strategy instances.
	 * @param scanner
	 */
	void readGlobalParameters (Scanner scanner)
		throws ParsingException;
	/**
	 * Writes global parameters that affect the behaviour of all game and strategy instances.
	 * @param ps
	 */
	void writeGlobalParameters (PrintStream ps);
}

// Local Variables:
// mode: java
// mode: flyspell-prog
// ispell-local-dictionary: "british"
// End:
